//
//  AfanHomeTitleButton.swift
//  weibo
//
//  Created by afan on 16/3/26.
//  Copyright © 2016年 阿范. All rights reserved.
//

import UIKit

class AfanHomeTitleButton: UIButton {
    
    convenience init(title: String, imageName: String){
        self.init()
        
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        sizeToFit()
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        titleLabel?.frame.origin.x = 0
        imageView?.frame.origin.x = titleLabel!.frame.width + 3
        
    }
    
    
}
